import service from "../request/myService";

// 获取详情页商品数据
export const getDetailApi = (params) => service.get('/api/good/goodinfo', { params })

// 收藏列表
export const collectListApi = (params) => service.get('/api/good/favlist', { params })


// 商品收藏
export const collectGoodApi = (data) => {
    return service({
        url: "/api/good/fav",
        method: "post",
        data
    })
}

// 取消收藏
export const ChangecollectGoodApi = (data) => service.post('/api/good/unfav', { data })

// 加入购物车（数量加一）
// export const addGoodsToCartApi = (data) => service.post('/api/shopcart/add', { data })
export const addGoodsToCartApi = (data) => {
    return service({
        url: "/api/shopcart/add",
        method: "post",
        data
    })
}